import java.io.File;

public class eg10_1 {
    public static void main(String[] args) {
        File currentDir  = new File(".");
        System.out.println("Files in:"+currentDir.getAbsolutePath());
        String[] files = currentDir.list();
        int dirCount =0,fileCount = 0;
        long fileSize = 0;
        for (int i = 0;i <files.length;i++){
            File tempFile = new File(files[i]);
            if (tempFile.exists()){
                if (tempFile.isFile()){
                    System.out.println(files[i]+"\t"+tempFile.length());
                    fileCount++;
                    fileSize =  fileSize + tempFile.length();
                }
                if (tempFile.isDirectory()){
                    System.out.println(files[i]+"\t<DIR>");
                    dirCount++;
                }
            }
        }
        System.out.println(fileCount+  "File(s)\t"+fileSize+"Byytes");
        System.out.println(dirCount+"Dir(s)");
    }
}
